package cn.tx.doubaodemo.common.exception;


import cn.tx.doubaodemo.common.result.ResultCodeEnum;
import lombok.Getter;

import java.io.Serial;

/**
 * @author tx
 * @date 2022/8/29 10:47
 */
@Getter
public class IException extends RuntimeException {

    @Serial
    private static final long serialVersionUID = 1927060647748438333L;

    private int code;

    public IException(String msg) {
        super(msg);
    }

    public IException(ResultCodeEnum resultCode) {
        super(resultCode.getMessage());
        this.code = resultCode.getCode();
    }

}
